//jmbrinkhus
//Nov 22 2009
//Code needs to be added to handle all three types of questions
//as well as multi-choice questions with < 5 possible responses.

import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import javax.swing.*;

public class PreviewSurvey extends JPanel{ /*implements ActionListener, FocusListener{*/
    //private ArrayList<JPanel> questionPanels;// = new ArrayList<JPanel>();
    private Question[] questionList; // = DBOps.getSurveyQuestions(0);

    public PreviewSurvey(){
    
	    this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		// amm - I commented out this db function to get it to compile
		// and dbops isn't done yet
	    //questionList = DBOps.getSurveyQuestions(0);
	    
	    
	    for(int i=0; i<questionList.length-1;i++){
			//  this.add(new QuestionPanel(questionList[i], i+1));
		}
    
    }
	/*
	possibleAns = q.getPossibleAns();
	questionPanel = new JPanel();
	questionPanel.setLayout(new BorderLayout());
	quesNumLabel = new JLabel(String.valueOf(quesNum)+".");
	quesLabel = new JLabel(q.getContent());
	response1 = new JLabel((q.getPossibleAns())[0]);
	response2 = new JLabel((q.getPossibleAns())[1]);
	radio1 = new JRadioButton();
	radio2 = new JRadioButton();
	buttonGroup = new ButtonGroup(radio1, radio2);
	numberOfPossibleAns = q.getNumberAns();
	main = new JPanel();
	left = new JPanel();
	rowq = new JPanel();
	row1 = new JPanel();
	row2 = new JPanel();
	main.setLayout(new BoxLayout(main,BoxLayout.Y_AXIS));
	left.setLayout(new FlowLayout());
	rowq.setLayout(new FlowLayout());
	row1.setLayout(new FlowLayout());
	row2.setLayout(new FlowLayout());
	left.add(quesLabel);
	row1.add(radio1);
	row1.add(response1);
	row2.add(radio2);
	row2.add(response2);
	main.add(rowq);
	main.add(row1);
	main.add(row2);
	if(numberOfPossibleAns > 2){
	  row3 = new JPanel();
	  row3.setLayout(new FlowLayout());
	  radio3 = new JRadioButton();
	  response3 = new JLabel((q.getPossibleAns())[2]);
	  buttonGroup.add(radio3);
	  row3.add(radio3);
	  row3.add(response3);
	  main.add(row3);
	}
	if(numberOfPossibleAns > 3){
	  row4 = new JPanel();
	  row4.setLayout(new FlowLayout());
	  radio4 = new JRadioButton();
	  response4 = new JLabel((q.getPossibleAns())[3]);
	  buttonGroup.add(radio4);
	  row4.add(radio4);
	  row4.add(response4);
	  main.add(row4);
	}
	if(numberOfPossibleAns > 4){
	  row5 = new JPanel();
	  row5.setLayout(new FlowLayout());
	  radio5 = new JRadioButton();
	  response5 = new JLabel((q.getPossibleAns())[4]);
	  buttonGroup.add(radio5);
	  row5.add(radio5);
	  row5.add(response5);
	  main.add(row5);
	}

	questionPanel.add(questionPanel, BorderLayout.CENTER);
	questionPanel.add(questionPanel, BorderLayout.WEST);
	return questionPanel;	
	*/
	
	public static void main(String args[]){
		JFrame frame = new JFrame();
		frame.add(new PreviewSurvey());
		frame.setSize(500,500);
		frame.setVisible(true);
	    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
